// 删除收藏
const express = require('express')
// 引入连接池模块
const pool = require('../pool.js')
const router = express.Router()

// 删除足迹
// http://127.0.0.1:3000/scsc/1
router.delete('/:cid',(req,res,next) => {
    var obj=req.params
    pool.query('delete from qnls_collect where cid=?',[obj.cid],(err,r) => {
        if(err){
            return next(err)
        }
        if(r.affectedRows===0){
			res.send({code:400,msg:'删除失败'})
		}else{
			res.send({code:200,msg:'删除成功'})
		}
    })
})


module.exports = router